/**
 * @file Condition.hh
 * @author zziywang (zziywang@163.com)
 * @brief { life is too short to learn cpp! }
 * @version 1.0
 * @date 2022-05-08
 *
 * @copyright Copyright (c) 2022
 *
 */

#include "Noncopyable.hh"
#include <pthread.h>

namespace snow
{

class MutexLock;
class Condition
    : Noncopyable
{
public:
    Condition(MutexLock &mutex);
    ~Condition();

    void wait();
    void notify();
    void notifyAll(); // broadcast

private:
    MutexLock &mutex_;
    pthread_cond_t cond_;
};

} // namespace snow